/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chameleon.view.command;



import chameleon.view.OutputManager;
import chameleon.view.Tag;
import chameleon.view.input.Input;

/**
 * This class is the general pattern for a command. This class contains : 
 *  -the input,
 *  -an outputManager for send message to the use,
 *  -two boolean to know if the command is in help mode and to know if we have
 * the quit colmmand.
 *
 *
 * @author simon
 */
public abstract class Command {

    protected Input input_;
    protected OutputManager outputManager_;
    protected boolean quit_;
    protected boolean help_;

    protected Command(Input input, boolean quit, boolean help){
        input_ = input;
        quit_ = quit;
        outputManager_ = new OutputManager();
        help_ = help;
    }

    abstract public Input execute();

    /**
     * This method return the tag, if they exists, to the corresponding string
     * given on input.
     * @param toolName
     * @return
     */

    protected int getToolTag(String toolName){
        if (toolName.equals("NuGat"))
            return Tag.NUGAT;
        else
            return -1;
    }

    public boolean quit(){
        return quit_;
    }
}
